#ifndef _HAL_NAND_ERROR_H
#define _HAL_NAND_ERROR_H

#define HAL_NAND_SUCCESS													0

#define HAL_NAND_ERROR_START											12000	

// hal_nand_error_enum

#define HAL_NAND_FAIL														(HAL_NAND_ERROR_START+1) // general fail kind
#define	HAL_NAND_ERR_ABORTED										(HAL_NAND_ERROR_START+2)
#define	HAL_NAND_ERR_TIME_OUT										(HAL_NAND_ERROR_START+3)
#define	HAL_NAND_ERR_CONTROLLER_BUSY						(HAL_NAND_ERROR_START+4)
#define	HAL_NAND_ERR_NAND_BUSY									(HAL_NAND_ERROR_START+5)
#define	HAL_NAND_ERR_WRITE_PROTECTED						(HAL_NAND_ERROR_START+6)
#define	HAL_NAND_ERR_PROGRAM_FAIL								(HAL_NAND_ERROR_START+7)
#define	HAL_NAND_ERR_ERASE_FAIL									(HAL_NAND_ERROR_START+8)
#define	HAL_NAND_ERR_READ_FAIL									(HAL_NAND_ERROR_START+9)
#define	HAL_NAND_ERR_ILL_GOOD_BLOCK_REQUEST			(HAL_NAND_ERROR_START+10)
#define	HAL_NAND_ERR_OUT_OF_GOOD_BLOCK					(HAL_NAND_ERROR_START+11)
#define	HAL_NAND_ERR_HEADER_NOT_AT_PHYSICAL_0		(HAL_NAND_ERROR_START+12)
#define	HAL_NAND_ERR_HEADER_NOT_AT_PHYSICAL_1		(HAL_NAND_ERROR_START+13)
#define	HAL_NAND_ERR_NOT_2_CONTINUOUS_GOOD_BLK	(HAL_NAND_ERROR_START+14)
#define HAL_NAND_ERR_PHY_BLK_ADDR_OUT_OF_RANGE	(HAL_NAND_ERROR_START+15)
#define HAL_NAND_ERR_PHY_BLK_ADDR_NOT_FOUND			(HAL_NAND_ERROR_START+16)
#define HAL_NAND_ERR_DATA_ALL_FF								(HAL_NAND_ERROR_START+17)
#define HAL_NAND_ERR_INVALID_GBT								(HAL_NAND_ERROR_START+18)
#define HAL_NAND_ERR_NULL_GBT										(HAL_NAND_ERROR_START+19)
#define HAL_NAND_ERR_CHECKSUM										(HAL_NAND_ERROR_START+20)
#define HAL_NAND_ERR_SIG												(HAL_NAND_ERROR_START+21)
#define HAL_NAND_ERR_USER_PARTITION_HEADER_CHECKSUM		(HAL_NAND_ERROR_START+22)
#define HAL_NAND_ERR_USER_PARTITION_HEADER_SIG				(HAL_NAND_ERROR_START+23)

#define	HAL_NAND_ERR_NO_MEDIUM									ENOMEDIUM
#define	HAL_NAND_ERR_NO_MEM											ENOMEM
#define	HAL_NAND_ERR_NO_PERM										EPERM
#define HAL_NAND_ERR_NO_DEVICE									ENODEV
#define HAL_NAND_ERR_INVAL_ARG									EINVAL
#define HAL_NAND_ERR_OVER_FLOW									EOVERFLOW

#endif //_HAL_NAND_ERROR_H